package platform.bio.server;

import platform.common.CommonInfo;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.nio.charset.Charset;

public class BioServer extends Thread{
    ServerSocket socket =null;

    public static void main(String[] args) {
        Integer i1 =100;
        Integer i2 =100;
        Integer i3 =200;
        Integer i4 =200;

        System.out.println(i1==i2);
        System.out.println(i3.equals(i4));

        int i5 =100;
        int i6 =100;
        int i7 =40000000;
        int i8 =40000000;
        System.out.println(i5==i6);
        System.out.println(i7==i8);

        BioServer bioServer = new BioServer();
        bioServer.start();


    }


    @Override
    public void run() {
       try{
           socket = new ServerSocket();
           socket.bind(new InetSocketAddress(CommonInfo.port));
           System.out.println("bio服务启动");
           while (true){
               Socket socket1 = socket.accept();
               BioServerHandler handler = new BioServerHandler(socket1, Charset.forName("GBK"));
               handler.start();
           }
       } catch (IOException e) {
           throw new RuntimeException(e);
       }
    }
}
